<template>
 <div class="container" >
    <ul ref="userList" class="nav">
        <li>aaa</li>
    </ul>
    <button @click="add">增加</button>
 </div>
</template>
<script>
 export default {
 name: '',
 data: function(){
 return {
    index:0
 }
 },
 methods:{
    add:function(){
       var node = document.createElement("li");
       var textnode = document.createTextNode("index:" + this.index++);
        node.appendChild(textnode);
        this.$refs.userList.appendChild(node);
    }
 }
 }
</script>
<style>
html,
 body, 
 #app{
 height: 100%;
 }
</style>
<style scoped>
 .container {
 display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center;
 width: 100%;
 height: 100%;
 background-color: aliceblue;
 }
 .tr{
 width: 200px;
 flex-basis: 50px;
 display: flex;
 flex-direction: row;
 justify-content: space-between;
 background-color: beige;
 align-items: center;
 }
 .second{
 background-color: aqua;
 }
 .nav{
    list-style: none;
 }
 .nav > li{
    cursor: pointer;
 }
 .nav > li:hover{
    background-color: rgb(17, 131, 230);
 }

</style>